﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.SessionState;
using JTicket.Common;
namespace JTicket.UI
{
    public class Global : System.Web.HttpApplication
    {

        protected void Application_Start(object sender, EventArgs e)
        {
            //注册错误日志配置节
            log4net.Config.XmlConfigurator.Configure();

        }

        protected void Session_Start(object sender, EventArgs e)
        {

        }

        protected void Application_BeginRequest(object sender, EventArgs e)
        {

        }

        protected void Application_AuthenticateRequest(object sender, EventArgs e)
        {

        }

        protected void Application_Error(object sender, EventArgs e)
        {   //记录错误日志
            Exception ex = Server.GetLastError().GetBaseException();
            Logger.Log.Error(HttpContext.Current.Request.UserHostAddress + ":" + ex.Message, ex);
            Config.UIConfig.ResponseErrorPage(ex.Message.ToString());
        }
        protected void Session_End(object sender, EventArgs e)
        {

        }
        protected void Application_End(object sender, EventArgs e)
        {

        }
    }
}